let request = require('../../../utils/request');

let requestApi = {

};

//获取我购买的课程
requestApi.getMyCourse = (data, loading = true) => {
	return request({
		url: '/courseUser/getMyCourse',
        method:'POST',
		loading,
		data,
	});
}

//获取商城课程
requestApi.getShopCourse = (data, loading = true) => {
	return request({
		url: '/courseUser/getShopCourse',
        method:'POST',
		loading,
		data,
	});
}

//课程详情
requestApi.getCourseDetail = (data) => {
	return request({
		url: '/courseUser/getDetail',
		data,
	});
}

//置顶课程
requestApi.courseUpdateTop = (data) => {
	return request({
		url: '/courseUser/updateTop',
		data,
	});
}

//购买
requestApi.buyCourse = (data, loading = true) => {
	return request({
		url: '/courseUser/buy',
        method:'POST',
		loading,
		data,
	});
}

// 支付下单
requestApi.placeOrder = (data, loading = true) => {
	return request({
		url: '/pay/aliPay/course',
		loading,
		data,
	});
}



module.exports = requestApi;